<template>
  <div class="app-container">
    <el-tabs v-model="activeName" @tab-click="handleLoad">
      <el-tab-pane label="设 置" name="setting">
        <setting :key="timer1" />
      </el-tab-pane>
      <el-tab-pane label="已提交" name="submitted">
        <submitted :key="timer2" />
      </el-tab-pane>
      <el-tab-pane label="审 批" name="checking">
        <checking :key="timer3" />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import setting from './setting'
import checking from './checking'
import submitted from './submitted'
export default {
  name: 'Setting',
  components: {
    setting,
    checking,
    submitted
  },
  data() {
    return {
      activeName: 'setting',
      timer1: '',
      timer2: '',
      timer3: ''
    }
  },
  methods: {
    handleLoad(data) {
      const name = data.name
      if (name === 'setting') {
        this.timer1 = new Date().getTime()
      } else if (name === 'submitted') {
        this.timer2 = new Date().getTime()
      } else if (name === 'checking') {
        this.timer3 = new Date().getTime()
      }
    }
  }
}
</script>

<style>

</style>
